/*    */ package com.qmsk.business.megSend;
/*    */ 
/*    */ import java.io.FileInputStream;
/*    */ import java.io.IOException;
/*    */ import java.io.InputStream;
/*    */ import java.util.Enumeration;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ import java.util.Properties;
/*    */ import org.apache.log4j.Logger;
/*    */ 
/*    */ public class PropertiesUtil
/*    */ {
/* 14 */   private static final Logger log = Logger.getLogger(PropertiesUtil.class);
/*    */ 
/*    */   public static Map<String, String> readProperties(String filePath) {
/* 17 */     Map map = new HashMap();
/* 18 */     InputStream input = null;
/* 19 */     Properties pro = null;
/*    */     try {
/* 21 */       pro = new Properties();
/* 22 */       input = new FileInputStream(filePath);
/* 23 */       pro.load(input);
/* 24 */       Enumeration en = pro.propertyNames();
/* 25 */       String key = null;
/* 26 */       String value = null;
/* 27 */       while (en.hasMoreElements()) {
/* 28 */         key = (String)en.nextElement();
/* 29 */         value = (String)pro.get(key);
/* 30 */         if ((key != null) && (key.trim().length() > 0))
/* 31 */           map.put(key, value);
/*    */       }
/*    */     }
/*    */     catch (Exception e) {
/* 35 */       log.error(e.getMessage());
/*    */     } finally {
/* 37 */       if (input != null) {
/*    */         try {
/* 39 */           input.close();
/*    */         } catch (IOException e) {
/* 41 */           log.error(e.getMessage());
/*    */         }
/*    */       }
/*    */     }
/* 45 */     return ((map.isEmpty()) ? null : map);
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.megSend.PropertiesUtil
 * JD-Core Version:    0.5.3
 */